package com.mxprojects.constructors
{
	import flash.display.MovieClip;

	public class DropdownList extends MovieClip
	{
		public var listTop:MovieClip;
		public var listMiddle:MovieClip;
		public var listBottom:MovieClip;
		
		public function DropdownList()
		{
		}
		
		public function setup(setWidth:int, setHeight:int):void {
			//snap this to the left
			x = 0;
			y = 0;
			
			//first get the middle part all snapped in place
			listMiddle.y = listTop.height;
			height = setHeight;

			//now make the whole thing fat
			listTop.width = setWidth;
			listMiddle.width = setWidth;
			listBottom.width = setWidth;
		}
		
		override public function set height(newHeight:Number):void {
			//this way it'll only change the height of the middle part
			listMiddle.height = newHeight;
			listBottom.y = listMiddle.y + listMiddle.height;
		}
		
		override public function set width(newWidth:Number):void {
			listTop.width = newWidth;
			listMiddle.width = newWidth;
			listBottom.width = newWidth;
		}
	}
}